import routes from './routers';
import { resolve } from 'path';
import config from './dev';
const { apiUrl } = config;

export default {
  history: 'hash',
  // base: './',
  publicPath: './',
  routes,
  treeShaking: true,
  plugins: [
    [
      'umi-plugin-react',
      {
        antd: true,
        dva: true,
        dynamicImport: true,
        dll: true,
      },
    ],
    // `${__dirname}/script.js`,
  ],
  hash: true,
  theme: {
    "primary-color": "#34C5D2",
  },
  alias: {
    '@': resolve(__dirname, '../src'),
    '@u': resolve(__dirname, '../src/utils'),
    '@c': resolve(__dirname, '../src/components'),
    '@ajax': resolve(__dirname, '../src/utils/ajax.js'),
  },
  proxy: {
    '/yclApi': {
      target: apiUrl,
      changeOrigin: true,
      pathRewrite: {
        '^/yclApi': '',
      },
    },
  }
};

